﻿
using System;
namespace MyFloridaHouse.libSvOpenDistricts.ViewModel
{
    public delegate void NotifyUserEventHandler(NotifyUserEventHandlerArgs e);

    public class NotifyUserEventHandlerArgs
    {
        public string message;
        public Exception ex;


        public NotifyUserEventHandlerArgs(string message, Exception ex)
        {
            this.message = message;
            this.ex = ex;
        }
    }

    public partial class ViewModelBase
    {
        public static event NotifyUserEventHandler NotifyUser;

        public static void RaiseNotifyUser(string message, Exception ex)
        {
            if (NotifyUser != null)
            {
                NotifyUserEventHandlerArgs args = new NotifyUserEventHandlerArgs(message, ex);
                NotifyUser(args);
            }
        }
    }
}

